package com.ldp.designpatterns.study.factory.simpleFactory;

import com.ldp.designpatterns.study.factory.simpleFactory.factory.CoffeeFactory;
import com.ldp.designpatterns.study.factory.simpleFactory.service.Coffee;

/**
 * @ClassName FactoryPatternDemo
 * @Description 简单工厂模式——步骤 4:使用该工厂，通过传递类型信息来获取实体类的对象
 * @Author lindipei
 * @Date 2023/10/13 11:09
 */
public class SimpleFactoryDemo {

    public static void main(String[] args) {
        CoffeeFactory coffeeFactory = new CoffeeFactory();

        //调用美式咖啡
        Coffee americanCoffee = coffeeFactory.getShape("American");
        americanCoffee.addsugar();

        //调用拿铁咖啡
        Coffee latterCoffe = coffeeFactory.getShape("RECTANGLE");
        latterCoffe.addsugar();


    }
}
